<?php
/**
* 昵称长度不确定，1-26位，随机
*/

if ( !$_SESSION['nickname'] ) {
    $len = mt_rand( 1, 26 );
    echo '<br>';
    $str = 'abcdefghijklmnopqrstuvwxyz';
    for ( $i = 0; $i<$len; $i++ ) {
        $code = mt_rand( 0, 25 );
        $nickname .= $str[$code];
    }
    echo "欢迎:{$nickname}";
    echo '<br>';
    $_SESSION['nickname'] = $nickname;
    //存入名字
    
}
echo $_SESSION['nickname'];
echo "<br>";
?>

<a href="/day04/show.php">展示</a>

<a href="/day04/delete.php">退出</a>

